<HTML><HEAD><TITLE>session_commit(++Session)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(dbi)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>session_commit(++Session)</H1>
commits transactional changes made to the database.
<DL>
<DT><EM>Session</EM></DT>
<DD>A session handle
</DD>
</DL>
<H2>Description</H2>
<P>
 This commits any transactional updates to the database made within Session.
 By default, transactional updates are local to the session, and the changes
 only become global when a commit occurs, e.g. when session_commit/1 is
 executed. Note that non-transactional updates become globally visible 
 immediately.
</P><P>
 When executed within the scope of a session_transaction/2 goal, this
 predicate simply succeeds without doing anything.
<H3>Exceptions</H3>
<DL>
<DT><EM>(5) type error </EM>
<DD>Session is not a valid session handle
<DT><EM>(dbi_error) </EM>
<DD>Problems from DBMS during commit.
</DL>
<H2>Examples</H2>
<PRE>
    session_sql(Session, "insert into mytable values ('a')", _),
    session_commit(Session), % committing the insert of a to table mytable 
</PRE>
<H2>See Also</H2>
<A HREF="../../lib/dbi/session_rollback-1.html">session_rollback / 1</A>, <A HREF="../../lib/dbi/session_transaction-2.html">session_transaction / 2</A>
</BODY></HTML>
